﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="HRDEvaluateDateConfig.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.HRDEvaluateDateConfig" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/Style.css" rel="stylesheet" type="text/css" />    

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">

        function ItemClicked(evaluation_round_seq, round_no) {
            radopen("HRDEvaluateDateConfig_POP.aspx?RoundSeq=" + evaluation_round_seq + "&RoundNo=" + round_no +"&Mode=" + "Edit", "POP");
            return false;
        }

        function closeRadWindow(oWnd, args) {
            var arg = args.get_argument();
            if (arg !== "" && arg !== null) {
                document.getElementById("<%= hdfYear.ClientID %>").value = arg;
            }

            $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest();
        }

    </script>
 </telerik:RadCodeBlock>

 <telerik:RadWindowManager 
        ID="RadWindowManager1" 
        ShowContentDuringLoad="false" 
        VisibleStatusbar="false" 
        ReloadOnShow="true" 
        runat="server" 
        Skin="Web20" 
        Modal="true" 
        KeepInScreenBounds="true" 
        Style="z-index: 7000">
        <Windows>
            <telerik:RadWindow 
                ID="POP" 
                runat="server" 
                Width="1000px" Height='600px'
                Behaviors="Reload, Close" OnClientClose="closeRadWindow" >
            </telerik:RadWindow>
        </Windows>
</telerik:RadWindowManager>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" onAjaxReQuest="RadManager1_AjaxReQuest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="txtRadYear">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="txtRadYear" />
                <telerik:AjaxUpdatedControl ControlID="grdRadRound" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="cmdAddNew">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="cmdAddNew" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="txtRadYear" />
                    <telerik:AjaxUpdatedControl ControlID="grdRadRound" />                 
                </UpdatedControls>
            </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager> 


<br />
<div class="Background980V2">
    <asp:HiddenField ID="hdfYear" runat="server" />
    <table id="tblRound" cellpadding="0" cellspacing="0"  style="height:50px;">
        <tr>
            <td width="100px"  align="right">
               ปีการประเมิน :
            </td>
            <td width="130px" align="center">
                <telerik:RadNumericTextBox ID="txtRadYear" runat="server" Width="120px" 
                    AutoPostBack="True" MinValue="2500" MaxValue="3000" MaxLength="4" 
                    ShowSpinButtons="true" ontextchanged="txtRadYear_TextChanged">
                    <NumberFormat DecimalDigits="0" GroupSeparator="" />
                </telerik:RadNumericTextBox>
            </td>
        </tr>
    </table>


<br />

<div class="button" >
    <asp:LinkButton ID="cmdAddNew" runat="server" onclick="cmdAddNew_Click">
        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/AddRecord.gif" /> เพิ่มรอบการประเมิน
    </asp:LinkButton>

<%--    <asp:LinkButton ID="lbnAddNew" runat="server" style="margin-right:20px;"   
        onclick="cmdAddNew_Click" Font-Overline="False" Font-Underline="False" Enabled="false" >
        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/AddRecord.gif" />
        &nbsp;<span style="text-decoration:underline">เพิ่มรอบการประเมิน</span>
    </asp:LinkButton> --%>

   <telerik:RadGrid ID="grdRadRound" runat="server" AutoGenerateColumns="false" OnItemCommand="grdRadRound_ItemCommand" >
        <MasterTableView NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;" DataKeyNames="evaluation_round_seq">

            <ColumnGroups>
                <telerik:GridColumnGroup Name="Round" HeaderText="รอบการประเมิน">   
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />                 
                </telerik:GridColumnGroup>
                <telerik:GridColumnGroup Name="Permission" HeaderText="อนุญาตให้ประเมิน">  
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />                   
                </telerik:GridColumnGroup>
            </ColumnGroups>
            
            <Columns>

                <telerik:GridTemplateColumn AllowFiltering="false" visible="true"  >
                    <HeaderStyle HorizontalAlign="Center" Width="30px" />
                    <ItemTemplate>
                        <asp:ImageButton ID="btnEdit" runat="server" BorderWidth="0px" ToolTip="คลิกเพื่อแก้ไขรายการ"
                        OnClientClick='<%# String.Format("ItemClicked({0},{1})",Eval("evaluation_round_seq"),Eval("round_no")) %>'
                        ImageUrl="../Images/Buttons/Edit.gif"  />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

                <telerik:GridTemplateColumn AllowFiltering="false" visible="true" >
                    <HeaderStyle HorizontalAlign="Center" Width="30px" />
                    <ItemTemplate>
                        <asp:ImageButton ID="btnDelete" runat="server" BorderWidth="0px" ToolTip="คลิกเพื่อลบรายการ" 
                            OnClientClick="javascript:return confirm('ต้องการลบข้อมูลใช่หรือไม่')" CommandName="btnDelete"
                            ImageUrl="../Images/Buttons/Delete.gif" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

                <telerik:GridBoundColumn HeaderText="รอบที่" DataField="round_no" UniqueName="round_no" >
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="100px" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn HeaderText="ปีการประเมิน" DataField="round_year" UniqueName="round_year" >
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="100px" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridBoundColumn>                

                <telerik:GridBoundColumn HeaderText="วันที่เริ่มต้น" DataField="round_start_date" UniqueName="round_start_date" ColumnGroupName="Round" 
                    DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" >
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="120px" />
                    <ItemStyle HorizontalAlign="Right" />
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn HeaderText="วันที่สิ้นสุด" DataField="round_end_date" UniqueName="round_end_date" ColumnGroupName="Round"
                    DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" >
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="120px" />
                    <ItemStyle HorizontalAlign="Right" />
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn HeaderText="วันที่เริ่มต้น" DataField="permission_start_date" UniqueName="permission_start_date" ColumnGroupName="Permission"
                    DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" >
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="120px" />
                    <ItemStyle HorizontalAlign="Right" />
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn HeaderText="วันที่สิ้นสุด" DataField="permission_end_date" UniqueName="permission_end_date" ColumnGroupName="Permission"
                    DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" >
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="120px" />
                    <ItemStyle HorizontalAlign="Right" />
                </telerik:GridBoundColumn>  
                              
                <telerik:GridBoundColumn HeaderText="หมายเหตุ" DataField="remark" >
                    <HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Left" />
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>  
</div>
<br />
<br />
</div>
</asp:Content>
